<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,body{
            height: 100%;
        }
        body{
             /* 激活3D空间 */
             perspective: 600px;
             /* perspective-origin: 75% center; */
        }
        .box div{
            width:200px;
            height: 200px;
            background-color: rgb(127, 204, 255);
            opacity: 0.5;
            position: fixed;
            margin:auto;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            text-align: center;
            line-height: 200px;
            font-size: 30px;
            border-radius: 20px;
            transition: all 2s;
        }
        .box .top{
            transform-origin: center top;
            transform: rotateX(90deg)
        }
        .box .bottom{
            transform-origin: center bottom;
            transform: rotateX(-90deg);

        }
        .box .left{
            transform-origin: left center;
            transform: rotateY(-90deg);
        }
        .box .right{
            transform-origin: right center;
            transform: rotateY(90deg);
        }
        .box .front{
            transform: translateZ(200px);
        }
        .box{
            width: 600px;
            height: 600px;
            position: fixed;
            margin: auto;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            transform-style: preserve-3d;
            transition: all 10s;
            transform-origin: center center 100px;
        }
        .box:hover{
            transform: rotateX(360deg);
        }
        .box:hover .top {
            transform: rotateX(90deg) translateZ(100px);
        }
        .box:hover .left{
            transform: rotateY(-90deg) translateZ(100px);
        }
        .box:hover .right{
            transform: rotateY(90deg) translateZ(100px);
        }
        .box:hover .bottom{
            transform:  rotateX(-90deg) translateZ(100px);
        }
        .box:hover .behind{
            transform:  translateZ(-100px);
        }
        .box:hover .front{
            transform:  translateZ(300px);
        }

    </style>
</head>
<body>
    <div class="box">
        <div class="top">●</div>
        <div class="bottom">●●</div>
        <div class="left">●●●</div>
        <div class="right">●●●●</div>
        <div class="behind">●●●●●</div>
        <div class="front">●●●●●●</div>
    </div>
</body>
</html>